/**
 * TimeFormatter
 *
 * @author Chris Pratt
 *
 * 11/26/2009
 */
package com.anodyzed.onyx.text;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class TimeFormatter extends DateFormatter {

  /**
   * Constructor
   *  
   * @param parent The parent TextFormat 
   * @param key The Argument Index or Map Key for this node 
   * @param bean The additional Bean reference String 
   */
  public TimeFormatter (TextFormat parent,CharSequence key,CharSequence bean) {
    super(parent,key,bean);
    fmt = DateFormat.getTimeInstance();
  } //TimeFormatter

  /**
   * Constructor
   *  
   * @param parent The parent TextFormat 
   * @param key The Argument Index or Map Key for this node 
   * @param bean The additional Bean reference String 
   * @param style The Date Style
   */
  public TimeFormatter (TextFormat parent,CharSequence key,CharSequence bean,CharSequence style) {
    super(parent,key,bean);
    if(style.equals("short")) {
      fmt = DateFormat.getTimeInstance(DateFormat.SHORT);
    } else if(style.equals("medium")) {
      fmt = DateFormat.getTimeInstance(DateFormat.MEDIUM);
    } else if(style.equals("long")) {
      fmt = DateFormat.getTimeInstance(DateFormat.LONG);
    } else if(style.equals("full")) {
      fmt = DateFormat.getTimeInstance(DateFormat.FULL);
    } else {
      fmt = new SimpleDateFormat(style.toString());
    }
  } //TimeFormatter

} //*TimeFormatter
